home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pdox693.zip
/
TI519.ASC
< prev
next >
Wrap
Text File
|
1992-12-02
|
3KB
|
133 lines
PRODUCT : Paradox NUMBER : 519
VERSION : All
OS : DOS
DATE : December 2, 1992 PAGE : 1/2
TITLE : How to Remove Leading Blanks From All Records of a
Single Field
This Technical Information sheet illustrates how you can use PAL
to remove the leading blanks from a field for all records in a
table. In the example below, we are modifying a field named
"Short" within a table named "Tabname". The script removes the
leading blanks from all the "Short" values within the table
"Tabname". In your script, you need to substitute your tablename
for "Tabname" and your fieldname for "Short".
To create the script:
1. From the Paradox Menu, select Scripts
2. Editor
3. New (for versions earlier than 4.0, this choice would be
Write)
4. At the prompt type in a name for the script (i.e.
LEADBLNK)
5. You are now in the PAL Script Editor.
6. Type the script below:
EDIT "Tabname" ; Place table in edit mode.
SCAN ; Scan each element in table.
WHILE true ; Loop until all blanks are removed.
IF MATCH([Short]," ..",temp) = false THEN
QUITLOOP ; Leave while-loop, if
ENDIF ; no leading blanks exist.
[Short] = temp
; Update field value each
; time a blank is removed with the
; temporary variable temp.
ENDWHILE
ENDSCAN
Do_It! ; Save all changes.
PRODUCT : Paradox NUMBER : 519
VERSION : All
OS : DOS
DATE : December 2, 1992 PAGE : 2/2
TITLE : How to Remove Leading Blanks From All Records of a
Single Field
To play the script:
1. From the Paradox Menu, select Scripts | Play
2. At the prompt, type the name of the script
For additional information about PAL, refer to the PAL Reference
Guide (for versions earlier than 4.0, refer to the PAL User's
Guide).
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.